"use strict";
cc._RF.push(module, '9f1a4YSD35C1IKCfjV+NQIY', 'ParticleEffect');
// scripts/ParticleEffect.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("Util"),
    s = t("Global"),
    l = cc._decorator,
    c = l.ccclass,
    d = l.property,
    h = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e._speed = 0, e._scaleSpeed = 0, e._angle = void 0, e._dir = void 0, e._gravity = 0, e.starClips = [], e;
  }

  return n(e, t), e.prototype.init = function (t, e, o, i) {
    this.node.opacity = 255, this._gravity = 0, this.node.getComponent(cc.Sprite).spriteFrame = this.starClips[r.Util.getRandomInt(0, this.starClips.length)], this._speed = e, this._scaleSpeed = o, this.node.color = i, this.node.setRotation(t), this._angle = this.node.rotation / 180 * Math.PI, this._dir = cc.v2(Math.cos(this._angle), Math.sin(this._angle)), this._dir.normalize();
  }, e.prototype.update = function (t) {
    this._gravity += 20 * t, this.node.x += t * this._dir.x * this._speed, this.node.y -= t * this._dir.y * this._speed + this._gravity, this.node.scale > 0 ? this.node.scale -= this._scaleSpeed * t : (this.node.opacity = 0, r.Util.objectPool.putNodeIntoNodePool(s.PoolKey.star, this.node));
  }, a([d([cc.SpriteFrame])], e.prototype, "starClips", void 0), a([c], e);
}(cc.Component);

o["default"] = h;

cc._RF.pop();